// import { LANGUAGE_CODE, ADD_LANGUAGE } from "../constan";
import {Constant} from "../constan";
export interface languageActionProps {
  type: typeof Constant.LANGUAGE_CODE;
  payload: "zh" | "en";
}
interface AddLanguageProps {
  type: typeof Constant.ADD_LANGUAGE;
  payload: {
    name: string;
    code: string;
  };
}
export const languageAction = (
  languageCode: "zh" | "en"
): languageActionProps => {
  return {
    type: Constant.LANGUAGE_CODE,
    payload: languageCode,
  };
};

export const AddLanguage = (payload: {
  code: string;
  name: string;
}): AddLanguageProps => {
  return {
    type: Constant.ADD_LANGUAGE,
    payload,
  };
};
